package tech.kpretty;

import tech.kpretty.bean.Ticket;

public class SaleTicketDemo {
    public static void main(String[] args) {
        Ticket ticket = new Ticket();
        //new Thread(() -> {for (int i = 0; i < 51; i++) ticket.sale();}, "售票员1").start();
        //new Thread(() -> {for (int i = 0; i < 51; i++) ticket.sale();}, "售票员2").start();
        //new Thread(() -> {for (int i = 0; i < 51; i++) ticket.sale();}, "售票员3").start();
        new Thread(() -> {for (int i = 0; i < 51; i++) ticket.saleForLock();}, "售票员1").start();
        new Thread(() -> {for (int i = 0; i < 51; i++) ticket.saleForLock();}, "售票员2").start();
        new Thread(() -> {for (int i = 0; i < 51; i++) ticket.saleForLock();}, "售票员3").start();
    }
}

